package com.vcredit.creditcat.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.vcredit.creditcat.model.Relative;
import com.vcredit.creditcat.persistence.base.RelativeMapper;

/**
 * 
 **/
@Service
public class RelativeService {
	@Autowired
	private RelativeMapper mapper;

	public void insert(Relative obj) {
		mapper.insert(obj);
	}

	public void update(Relative obj) {
		mapper.update(obj);
	}

	public List<Relative> findAll() {
		return mapper.findAll();
	}

	public List<Relative> find(Relative obj) {
		return mapper.find(obj);
	}

	/**
	 * 根据授信流程查询联系人 relativeType=null时查询所有
	 * 
	 * @param processId
	 * @param relativeType
	 * @return
	 */
	public List<Relative> findByCustId(Long custId) {
		Relative queryParam = new Relative();
		queryParam.setThirdCustId(custId);
		return mapper.find(queryParam);
	}

}